#include <iostream>
#include <windows.h>
#include<stdio.h> // scanf,printf
#include<ctime> // time()
#include<fstream> // input&output files 
using namespace std;
int main()
{
    system("title Cyber_Divination(用户未授权)");
	cout<<"==- Cyber_Divination.console -== [/version 1.0]\n";
    cout<<"Language:\n";
	cout<<">>[Chinese 简体中文]\n";
    time_t now = time(NULL);
    tm time = *localtime(&now);
	int year = time.tm_year + 1900;
    int month = time.tm_mon + 1;
    int day = time.tm_mday;
    int hour = time.tm_hour;
    int min = time.tm_min;
    int sec = time.tm_sec;
    cout<<"Start time:\n";
	printf(">>%4d年%02d月%02d日 %3d:%02d:%02d\n",year,month,day,hour,min,sec); // time
	MessageBox(NULL,"                    ===-                          - Cyber Divination -                          -===\n\nThis procedure is made by [K.R.Chao]\nA Complitely New Type Divination Programme!\n\nAgreement content:\n  This program does not represent the author's point of view, please do not blindly listen to the words of divination, and do please retain your own ability to discriminate. This program is for entertainment, learning, or inaccurate reference only. The Program and its authors shall not be liable for any damage or loss caused by the Program or any content derived therefrom. By clicking '确定' and proceeding with the follow-up procedure, the user accepts this agreement.\n\n<//dcos:/lang.winMb==en.>"
	,"Attention!",MB_OK);
    Sleep(1000);
    cout<<"\n";
    system("cls");
	system("color 1f");
	system("title Cyber_Divination.console version 1.0");
	cout<<"==- Cyber_Divination.console -== [/version 1.0]\n\n";
	cout<<"Checking time:\n";
	printf(">>%4d年%02d月%02d日 %3d:%02d:%02d\n",year,month,day,hour,min,sec); // time
	Sleep(1000); 
	cout<<"请输入您的姓名：";
	//????
	std::ofstream outputFile;
    outputFile.open("example.txt"); // 打开名为example.txt的文件进行写入
	if (outputFile.is_open())
	{
    	outputFile << "Hello, World!" << std::endl; // 将字符串写入文件
    	outputFile << "This is a sample text." << std::endl;
	}
	else
	{
    	std::cout << "Failed to open the file." << std::endl; // 如果文件打开失败，输出错误信息
	}
	outputFile.close(); // 关闭文件流

	
	return 0;
}
/*
    fstream file("datatemp.txt", ios::in | ios::out); // 打开文件
    if (file.is_open()) // 检查文件是否成功打开 
    {
	    system("start C:\\Users\\Administrator\\Desktop\\CodingTools\\Pin-patch\\keyCode.exe");
		file.seekp(0); // 将文件指针移动到文件开头 
	    file << ">>For in:\n";
		file << "/data./\n";
		file << "/*" <<endl; // 将文本写入文件 
	    file.close(); // 关闭文件流 
	    cout << "File modified successfully.( √)" <<endl;
	}
	else
	{
		cout << "Failed to modify file.( ×)" <<endl;
    }	
*/

/*
	ofstream outfile("datatemp.txt"); // 创建新文件
	if (outfile.is_open()) // 检查文件是否成功打开 
	{
	    system("start C:\\Users\\Administrator\\Desktop\\CodingTools\\Pin-patch\\SourcesFile\\midway-firstrun.exe"); // 打开firstrun. 
		 
		outfile << ">>This is a data log text for storage.\n"; // 向文件中写入数据 
	    outfile << "N.B.\n";
	    outfile << ">>DO NOT Restart 'keyCode-Start(OnlyForFirstUse)' if you DO NOT want to reset or delete the data in the file 'dataemp.txt'.\n";
		outfile << "OR YOUR DATA WILL BE REMOVED." <<endl;
		outfile.close(); // 关闭文件流 
	    cout << "File created successfully." <<endl;
	}
	else
	{
		cout << "Failed to create file." <<endl;
	}
*/

/*

*/